<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var a = 10;
        //如果++在前,表示先运算,再赋值,如果是++在后,表示先赋值再运算
        // var b = a++;   //再运算,就是对a自己进行+1
        // var b = ++a;//先运算,先将a+1,后赋值,运算完后再对a的结果赋值给b
        // console.log(a, b);//11 10

        /*
            var b = a++
            console.log(a,b);//b = 10,a = 11

            console.log(10);

            var c = ++a;//c = 12,a=12
        */
        // console.log(a++ + ++a);//22

        // console.log(a-- + --a);//18,19
    </script>
</body>

</html>